﻿using Microsoft.Practices.Prism;
using Microsoft.Practices.Prism.Commands;
using Microsoft.Practices.Prism.Regions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;

namespace Ezpay.UI.ViewModels
{
    class SubscriptionViewModel
    {
        private Subscription _sub;
        private IRegionManager _regionManager;
        public ICommand NavigateCommand { get; set; }
        public SubscriptionViewModel(Subscription subscription, IRegionManager regionManager)
        {
            _sub = subscription;
            _regionManager = regionManager;
            NavigateCommand = new DelegateCommand(Navigate);
        }

        private void Navigate()
        {
            if (Type == "Housing")
            {
                var query = new UriQuery();
                query.Add("ID", Description);
                _regionManager.ShowInMain("HousingAgencyViewModel" + query.ToString());
            }
        }

        public string Description { get { return _sub.Description; } }
        public string Type { get { return _sub.Type; } }
    }
}
